# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:
pkgname=py3-django-js-asset
_pkgname=django-js-asset
pkgver=2.1
pkgrel=0
pkgdesc="script tag with additional attributes for django.forms.Media"
url="https://github.com/matthiask/django-js-asset"
arch="noarch"
license="BSD-3-Clause"
depends="py3-django"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-wheel
	"
checkdepends="py3-pytest py3-coverage"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/matthiask/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver
options="!check" # need more setup

replaces="py-django-js-asset" # Backwards compatibility
provides="py-django-js-asset=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
88a28ac55e9ca769acd21229cc3c0a49dc851f4606ba0623e376966a5869184880d5394d3c201c6e7063384b2d128b94b473c962688bda61e71976ef52cfad13  py3-django-js-asset-2.1.tar.gz
"
